package ${ApplicationPackage};

import com.askj.integration.application.ApplicationSupport;
import com.askj.integration.event.storage.LocalDomainEventResolver;
import com.askj.integration.infrastructure.aggregate.AggregateEventAwareSupport;
import com.askj.integration.infrastructure.proxy.IMapperProxy;
import ${EntityPackage}.${EntityClassName};
import ${RepositoryPackage}.${entity}Repository;
import ${CreateCommandPackage}.${CreateCommandClassName};
import ${ProxyPackage}.${entity}Proxy;
import lombok.AccessLevel;
import lombok.Setter;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Optional;

/**
 * @author ${author}
 */
@Slf4j
@Service
@AllArgsConstructor
public class ${entity}Application extends ApplicationSupport {

    private final ${entity}Repository repository;

    public String save(${CreateCommandClassName} command){
         ${EntityClassName} newEntity= repository.save(command.toAggregate());
         return newEntity.getId().toString();
    }

}
